﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MarkDownFileSplitter.Meilisearch
{
    internal class IndexTreeView
    {
        private static TreeView? m_treeView;

        public static void SetInstance(TreeView treeView)
        {
            m_treeView = treeView;
        }

        public static void AddTreeNode(TreeNode node)
        {
            m_treeView.Nodes.Add(node);
        }

        public static List<string> GetExistedIndexNames()
        {
            return m_treeView.Nodes.Cast<TreeNode>().Select(node => node.Text).ToList();
        }
    }
}
